<template>
	<div>
		<Header></Header> <!-- 子页面公共头部 -->
		<div class="ej_box">
			<div class="ej_center">
				<Crumbs :lmtitle="lmtitle"></Crumbs> <!-- 面包屑导航 -->
				<div class="clear"></div>
				<div class="row">
					<div class="col-md-3">
						<SeniorSearch @search="search"></SeniorSearch> <!-- 高级搜索 -->
					</div>
					<div class="col-md-9">
						<div class="ej_content_box">
							<div class="ej_content">
								<div class="ej_content_nav">
									<div class="ej_content_nav_pc">
										<h2 class="ej_content_nav_pc_h2dt">
											<li v-for="item in dhData" @click="link(item)"
												:class="form.columnId == item.id || (item.id == 99999 && form.columnId == '') ? 'activexz' : ''">
												{{ item.name }}</li>
										</h2>

										<div class="clearfix"></div>
									</div>
								</div>
								<div class="ej_content_editor" v-if="navId == 12">
									<div class="zcfg_con">
										<!--li  循环-->
										<div :class="index % 2 == 0 ? 'zcfg_li' : 'zcfg_li zcfgboxfr'"
											v-for="(item, index) in columnList">
											<div class="zcfg_licon">
												<div class="zcfg_li_top">
													<div class="zcfg_li_top_fl">{{ item.name }}</div>
												</div>

												<div class="zcfg_nr">
													<div class="xz_nrli" v-for="list in item.children">
														<div class="xz_nr">
															<i class="iconfont icon-fangkuai"></i>
															<div class="xz_nr_text">
																<p>{{ list.title }}</p>
																<div class="xz_nr_hz">
																	<!--栏目：{{ list.columnName }}
																	&nbsp;&nbsp;|&nbsp;&nbsp;-->
                                  发布时间：{{ list.createTime | formatDate }}
																	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span
																		v-if="list.fileUrl"
																		@click="down(list.fileUrl)">点击下载</span>
																</div>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
								<div class="ej_content_editor" v-else-if="navId == 13">
									<div class="zcfg_con">
										<!--li  循环-->
										<div :class="index % 2 == 0 ? 'zcfg_li' : 'zcfg_li zcfgboxfr'"
											v-for="(item, index) in columnList">
											<div class="zcfg_licon">
												<div class="zcfg_li_top">
													<div class="zcfg_li_top_fl">{{ item.name?item.name.replace("政策法规-",""):"" }}</div>
													<div class="zcfg_li_top_fr" @click="more(item.id, item.name)">更多<i
															class="iconfont icon-gengduo1"></i>
													</div>
												</div>
												<div class="zcfg_nr">
													<div class="zcfg_nrli" v-for="list in item.children">
														<div class="zcfg_nr_fl" @click="opendetails(list.id)">
															<i class="iconfont icon-fangkuai"></i>
															<p class="p1">
                                <span v-html="calcTitle(list.title,list)"></span>
                                <span class="dateSpan">{{ list.pubDate | moment('YYYY-MM-DD') }}</span>
                              </p>
															<img src="../assets/images/new.png" class="icon_new"
																v-if="list.newContent == 1">
															<img src="../assets/images/top.png" class="icon_top"
																v-if="list.topContent == 1">
														</div>
														<div class="zcfg_nr_fr" v-if="list.fileUrl"
															@click="down(list.fileUrl)">点击下载</div>

													</div>

												</div>
											</div>
										</div>
										<!--li  循环-->
									</div>
								</div>
								<div class="ej_content_editor" v-else-if="navId == 8">
									<!-- 精彩瞬间+精彩视频 -->
									<div class="zcfg_con2">
										<div class="spdb_ul spdb_ul_flex">
											<div class="spdb_ul_li" v-for="item in tablelist" :key="item.id"
												@click="openjcsj(item)">
												<div class="pic">
													<img :src="item.fengmian">
													<i v-if="item.fileUrl" class="iconfont icon-bofang"></i>
												</div>
												<div v-if="!item.fileUrl" class="hb_li_text">
													<p>{{ item.title }}</p>
													<div class="hb_li_text_hz">
														<div class="hb_li_text_hzfl">{{ item.organizationName }} |
															作者：{{ item.author }}
														</div>
														<div class="hb_li_text_hzfr">
															<i v-if="!item.contentThumbs" @click.stop="dianzan(item.id)"
																class="iconfont icon-dianzan_kuai gray"></i>
															<i v-else class="iconfont icon-dianzan_kuai"
																@click.stop="tip"></i>
															{{ item.thumbs }}
														</div>
													</div>
												</div>
											</div>


										</div>
									</div>
								</div>
								<div class="ej_content_editor" v-else-if="navId == 15">
									<!-- 视频点播列表 -->
									<div class="zcfg_con2 zcfg_con14">
										<div class="spdb_ul spdb_ul_flex">
											<div class="spdb_ul_li" v-for="item in tablelist" :key="item.id"
												@click="videodetails(item.id)">
												<div class="pic">
													<img :src="'/show' + item.url">
													<i class="iconfont icon-bofang"></i>

												</div>
												<div class="hb_li_text">
													<p>{{ item.title }}</p>
													<div class="hb_li_text_hz">
														<div class="hb_li_text_hzfl">{{ item.organizationName }} |
															作者：{{ item.author }}
														</div>
														<div class="hb_li_text_hzfr">
															<i v-if="!item.contentThumbs" @click.stop="dianzan(item.id)"
																class="iconfont icon-dianzan_kuai gray"></i>
															<i v-else class="iconfont icon-dianzan_kuai"
																@click.stop="tip"></i>
															{{ item.thumbs }}
														</div>
													</div>
												</div>
											</div>


										</div>
									</div>
								</div>
								<div class="ej_content_editor" v-else-if="navId == 14">
									<div class="zcfg_con">
										<!--li  循环-->
										<div :class="index % 2 == 0 ? 'zcfg_li' : 'zcfg_li zcfgboxfr'"
											v-for="(item, index) in gddtlist">
											<div class="zcfg_licon">
												<div class="zcfg_li_top">
													<div class="zcfg_li_top_fl">{{ item.orgName }}</div>
													<div class="zcfg_li_top_fr"
														@click="morejigou(item.orgId, item.orgName)">更多<i
															class="iconfont icon-gengduo1"></i>
													</div>
												</div>
												<div class="zcfg_nr">
													<div class="zcfg_nrli" v-for="list in item.contentList">
														<div class="zcfg_nr_fl" @click="opendetails(list.id)">
															<i class="iconfont icon-fangkuai"></i>
															<p>{{ list.title }}</p>
															<img src="../assets/images/new.png" class="icon_new"
																v-if="list.newContent == 1">
															<img src="../assets/images/top.png" class="icon_top"
																v-if="list.topContent == 1">
														</div>
														<div class="zcfg_nr_fr" v-if="list.fileUrl"
															@click="down(list.fileUrl)">点击下载</div>

													</div>

												</div>
											</div>
										</div>
										<!--li  循环-->
									</div>
								</div>
								<div class="ej_content_editor"
									v-else-if="navId == 1 || navId == 4 || navId == 5 || navId == 6 || navId == 7">
									<div class="zcfg_con2">

										<div class="dcyj_ul">
											<div class="dcyj_ul_li" v-for="item in tablelist" :key="item.id">

												<div class="dcyj_ul_lifl" @click="opendetails(item.id)">{{ item.title }}
												</div>
												<div class="dcyj_ul_lifr">
													<!--栏目：{{ item.columnName }}&nbsp;&nbsp;|&nbsp;&nbsp;-->
                          发布时间：{{
															item.createTime | formatDate
													}}
													&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
													<span v-if="item.fileUrl" @click="down(item.fileUrl)">点击下载</span>
												</div>

											</div>
										</div>

									</div>


								</div>
								<div class="ej_content_editor" v-else>
									<div class="zcfg_con2">
										<div class="jgdt_ul">
											<div class="jgdt_ul_li" v-for="item in tablelist" :key="item.id"
												@click="opendetails(item.id,item.columnId)">
												<div class="jgdt_ul_li_fl" v-if="item.urlTitle"
                             style="width: 25%;height: 165px;background: #047ADB;color: red;display: flex;justify-content: center;align-items: center;font-size: 25px;letter-spacing: 2px;font-weight: bold;">
													{{item.urlTitle}}
												</div>
												<div class="jgdt_ul_li_fl" v-else>
													<img :src="item.url" />
												</div>
												<div class="jgdt_ul_li_fr">
													<h2>{{ item.title }}</h2>
													<div class="tablecontent" v-html="item.content"></div>
													<div class="jgdt_ul_li_fr_hz">
														<!--栏目：{{ item.columnName }}|-->
														&nbsp;&nbsp;&nbsp;&nbsp;发布时间：{{ item.createTime | formatDate
														}}&nbsp;&nbsp;|&nbsp;作者：{{ item.author }}
														&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span>点击查阅</span>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
                <!--v-if="navId == 13 || navId==12" -->
								<div class="pgepagination"  v-if="navId != 13 && navId != 12">
									<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
										:current-page="form.pageNum" :page-sizes="[10, 20, 30, 50]"
										:page-size="form.pageSize" layout="total, sizes, prev, pager, next, jumper"
										:total="form.total">
									</el-pagination>
								</div>
							</div>
						</div>
					</div>

					<div class="clearfix"></div>
				</div>


			</div>
		</div>
		<Foot></Foot> <!-- 网站公共底部 -->
	</div>
</template>
<script>
import Cookies from 'js-cookie'
import Foot from "@/components/foot.vue";
import Crumbs from "@/components/crumbs.vue";
import SeniorSearch from "@/components/seniorsearch.vue";
import { contentFourData, contentApiqueryPage, columnqueryAll, contentThumbs, queryGroupByOrg } from "@/api/webpage";
import { queryFilterColumn } from "@/api/ip"
import Header from "@/components/header.vue";
export default {
	name: "articlelistpage",
	components: {
		Header,
		Crumbs,
		SeniorSearch,
		Foot
	},
	filters:{
    formatDate(data){
      return  data.split(' ')[0]
    },
  },
	data() {
		return {
		  newsIcon: require("../assets/images/news/xfyw.jpg"), // 默认是消防要闻
		  newsTypeTitle: "消防要闻", // 默认是消防要闻
			dhData: [],
			tablelist: [],
			lmtitle: '',
			navId: '',
			form: {
				columnId: '',
				approval: '1',
				pageNum: 1,
				pageSize: 10,
				total: 0
			},
			columnList: [],
			gddtlist: [],
			ids: '',
			dtId: '',
      gddtAllOrgList:[
        {
          orgId:"E4FFD28D67FD496D9ABA6A7919374656",
          orgName:"特勤大队",
          contentList:[]
        },
        {
          orgId:"4B90D58D74C142BD916B3EA1C7B16817",
          orgName:"朝阳大队",
          contentList:[]
        },
        {
          orgId:"900011053C4B47FF9ACAF0B09A2BA274",
          orgName:"宽城大队",
          contentList:[]
        },
        {
          orgId:"5475AFD297544FC89CFB1F948945901C",
          orgName:"南关大队",
          contentList:[]
        },
        {
          orgId:"5871EC7365D34FE5BD04DF121D337E9A",
          orgName:"二道大队",
          contentList:[]
        },
        {
          orgId:"34B6BCD6B7054FB2A03382FF196E209A",
          orgName:"绿园大队",
          contentList:[]
        },
        {
          orgId:"C177A1E649B34FEAB82E716E0ABBDF99",
          orgName:"经开大队",
          contentList:[]
        },
        {
          orgId:"486798A414A5457A8902B2F4BA90640D",
          orgName:"新区大队",
          contentList:[]
        },
        {
          orgId:"D1B12879306D40BFACD4E8283DFB7A2C",
          orgName:"净月大队",
          contentList:[]
        },
        {
          orgId:"6B0727445D7745F1861566880C7BBECA",
          orgName:"南部都市大队",
          contentList:[]
        },
        {
          orgId:"521B6C04140449599C28EA9D907B86B7",
          orgName:"汽开大队",
          contentList:[]
        },
        {
          orgId:"547D751F9C9644098BBF7FB4F658D746",
          orgName:"莲花山大队",
          contentList:[]
        },
        {
          orgId:"7732CC534E1E4530B20E1A2E5C8256BC",
          orgName:"重工大队",
          contentList:[]
        },
        {
          orgId:"CB3A1512C6DC4073BD4DC51444E69D44",
          orgName:"双阳大队",
          contentList:[]
        },
        {
          orgId:"E835EFAB19B4490DA944BDF32FB13743",
          orgName:"九台大队",
          contentList:[]
        },
        {
          orgId:"CDF1ACE87322407EAE33DA424B4F47A8",
          orgName:"公主岭大队",
          contentList:[]
        },
        {
          orgId:"A210F40D62A54F458CA738FF1F08D66B",
          orgName:"农安大队",
          contentList:[]
        },
        {
          orgId:"779B7C152620400185313C10A0E4203C",
          orgName:"榆树大队",
          contentList:[]
        },
        {
          orgId:"E17B0EAB1E09403F8BF6EFAB56E304EF",
          orgName:"德惠大队",
          contentList:[]
        },
      ]
		};
	},
	watch: {
		//监听路由地址的改变
		$route: {
			immediate: true,
			handler() {
			  console.log("需要监听的参数")
				if (this.$route.query.id) {//需要监听的参数
					this.form.columnId = this.$route.query.id
					this.navId = this.$route.query.navId
					this.dhData = JSON.parse(Cookies.get('navdata'))[this.$route.query.navId]
					JSON.parse(Cookies.get('navdata'))[this.$route.query.navId].forEach(item=>{
						if(item.id == this.$route.query.id ){
							this.lmtitle = item.name
						}
						// console.log(item,9888);
					})
					// this.lmtitle = JSON.parse(Cookies.get('navdata'))[this.$route.query.navId][0].name
					if (this.$route.query.navId == 12 || this.$route.query.navId == 13) {// 政策法规 下载中心
						this.getdownlist()
					} else if (this.$route.query.navId == 14) {// 各地动态
						this.getgddt(this.$route.query.id)
					} else { // 其他栏目
						this.getlist()
					}
				}
			}
		}
	},
	created() {
		this.dhData = JSON.parse(Cookies.get('navdata'))[this.$route.query.navId]
		this.navId = this.$route.query.navId
		if (this.$route.query.id == 99999) {
			this.form.columnId = ""
		} else {
			this.$route.query.id
		}




	},
	methods: {
    calcTitle(title,item){
      console.log("项目内容：",item);
      if(title && title.length>=14){
        return title.substring(0,14)+"...";
      }
      return title;
    },
    extractFirstParagraph(text) {
      const regex = /<\/p>|<br\s*\/?>/;
      const paragraphs = text.split(regex);
      if (paragraphs.length > 0) {
        return paragraphs[0];
      } else {
        return ""; // 如果没有找到段落，则返回空字符串
      }
    },
		// 各地动态
		getgddt(id) {
			queryGroupByOrg({ columnId: id }).then(res => {
				if (res.code == 0) {
          // 处理一下数据  看看缺什么 如果缺就需要添加到集合里
          let arr = res.data;
          if(res.data && res.data.length<19){
            // 遍历需要显示的19个机构 如果集合中没有  就存储到集合中
            this.gddtAllOrgList.forEach(item=>{
              if(! this.isExistOrg(res.data,item)){ // 不存在
                arr.push(item);
              }
            })
          }
					// this.gddtlist = res.data
					this.gddtlist = arr
				}
			})
		},
		handleSizeChange(val) {
			this.form.pageSize = val
      console.log("切换数据：",this.form);
      this.getlist()
		},
		handleCurrentChange(val) {
			this.form.pageNum = val
      console.log("切换数据：",this.form);
      this.getlist()
		},
    isExistOrg(gddtList,gddt){
      return  gddtList.some(item=>item.orgId == gddt.orgId)
    },
		getlist() {
			this.tablelist = []
			if (this.form.columnId && this.form.columnId != 99999) {
				this.form.niceContent = ''

			} else {
				this.form.niceContent = 1
				/*contentApiqueryPage(this.form).then(res => {
					if (res.code == 0) {
						if (res.rows.length != 0) {
							this.tablelist = res.rows.map(item => {
								if (item.content) {
									item.content = item.content.replace(/<\/?(img)[^>]*>/gi, '').slice(0, 150)
								}
								return item
							})
							this.form.total = res.total
						}
					}
				})*/
			}

			// 查询
      console.log("查询结果参数",this.form);
      contentApiqueryPage(this.form).then(res => {
        console.log("查询结果列表",res);
        if (res.code == 0) {
          if (res.rows.length != 0) {
            this.tablelist = res.rows.map(item => {
              //console.log("精彩瞬间title：",item.articleTitle);
              //console.log("精彩瞬间content：",item.content);
              /*if (item.url) {
                let urllist = item.url.split(",")
                item.fengmian = '/show' + urllist[0]
                item.url = '/show' + urllist[0]
              }else{ // 为空就需要对齐进行赋值内容中的第一张图片
                // 处理封面
                 let str = item.content;
                 let srcIndex = str.indexOf("src");
                 if(srcIndex==-1){ // 没找到图片
                    item.url = this.newsIcon;
                    item.urlTitle = this.newsTypeTitle;
                 }else{
                   let substring = str.substring(srcIndex+5, str.length);
                   let i = substring.indexOf("\"");
                   let substring1 = substring.substring(0, i);
                   item.url= substring1
                   item.urlTitle = "";
                 }
              }*/
              // 处理封面
              let str = item.content;
              let srcIndex = str.indexOf("src");
              if(srcIndex==-1){ // 没找到图片
                if(this.form.columnId == '39804870715F4427BDB177E39D726B54' || this.form.columnId == 'A6DA25D541C140B3AE4341A21A347320'){ // 精彩瞬间 视频
                  // console.log("精彩瞬间",item.url)
                  if (item.url) {
                    let urllist = item.url.split(",")
                    item.fengmian = '/show' + urllist[0]
                    item.url = '/show' + urllist[0]
                    // console.log("视频封面url...",item.url);
                    // console.log("视频封面fengmian...",item.fengmian);
                  }else{
                    item.url = this.newsIcon;
                    item.urlTitle = this.newsTypeTitle;
                  }
                }else{
                  item.url = this.newsIcon;
                  item.urlTitle = this.newsTypeTitle;
                }

              }else{ // 图片在内容中 截取图片
                let substring = str.substring(srcIndex+5, str.length);
                let i = substring.indexOf("\"");
                let substring1 = substring.substring(0, i);
                item.url= substring1
                item.fengmian= substring1 // 如果精彩瞬间或者精彩视频存在内容 就直接从内容中取图片
                item.urlTitle = "";
              }
              // 处理内容
              if (item.content) {
                /*item.content = item.content.replace(/<\/?(img)[^>]*>/gi, '').slice(0, 150)
                item.content = this.extractFirstParagraph(item.content);*/
                if(item.content.length>100){
                  let reg = /[\u4e00-\u9fa5]+/g
                  item.content = item.content.replace(/<.*?>/g,"").replace(/&nbsp;/ig,'').slice(0, 100)
                  let subContent = item.content.substring(99,100)
                  if(subContent.match(reg)){
                    item.content = item.content+"..."
                  }else{
                    item.content = item.content.slice(0,99)+"..."
                  }

                }else{
                  item.content = item.content.replace(/<.*?>/g,"")
                }
              }
              return item
            })
            this.form.total = res.total
          }
          // console.log("数据列表：",this.tablelist);
        }
      })


		},
		link(row) {
      this.form.pageNum = 1;// 初始化第一页
			let _this = this
			this.lmtitle= row.name
			if (row.id == 99999) {
				_this.form.columnId = ""
        this.newsTypeTitle = "推荐阅读";
			} else {
				_this.form.columnId = row.id
			}
			if (_this.$route.query.navId == 12 || _this.$route.query.navId == 13) {
				_this.getdownlist()
			} else if (_this.$route.query.navId == 14) {
				_this.getgddt(row.id)
			} else {
			  // 需要图片
        console.log("切换的栏目ID",row.id)
        if(row.id== '22F1EBCBBC7648B8827DC74E50319B24'){//消防要闻
          console.log('点击消防要闻')
          this.newsTypeTitle = "消防要闻";
        }else if(row.id== '0E1E9FAD3D9F40AEB4CAF8D9701B8C8B'){//领导批示
          console.log('点击领导批示')
          this.newsTypeTitle = "领导批示";
        }else if(row.id== '4C0C99596A544CD298F62445DA3CFF87'){//地方消防
          console.log('点击地方消防')
          this.newsTypeTitle = "地方消防";
        }else if(row.id=='99999'){//推荐阅读
          console.log('点击推荐阅读')
          this.newsTypeTitle = "推荐阅读";
        }else if(row.id == 'FF856FAB8CC54303A8197B981AFB1EE8'){//交接班
          console.log('点击交接班')
          this.newsTypeTitle = "交接班";
        }else if(row.id=='4BF37E6D3E194FD8879F7ED7B4B006BE'){ // 机关动态
          console.log('点击机关动态')
          this.newsTypeTitle = "机关动态";
        }else if(row.id=='F0CFAC8B75F84B52B5F0A44ABB17817C'){ // 机关动态
          console.log('点击值班日记')
          this.newsTypeTitle = "值班日记";
        }else if(row.id=='FE9D74C4870047468AC6F8267C5E1481'){ // 机关动态
          console.log('考勤情况')
          this.newsTypeTitle = "考勤情况";
        }
				_this.getlist()
			}

			// queryFilterColumn().then(res => {
			// 	if (res.code == 0) {
			// 		console.log(res);
			// 		let array = []
			// 		array = res.data.map(item => {
			// 			return item.id
			// 		})

			// 		_this.ids = array.join(",")
			// 		if (_this.ids && _this.ids.includes(row.id)) {

			// 			_this.tablelist = []
			// 			_this.$message.warning("无权限查看该栏目")
			// 		} else {
			// 			this.lmtitle= row.name
			// 			if (row.id == 99999) {
			// 				_this.form.columnId = ""
			// 			} else {
			// 				_this.form.columnId = row.id
			// 			}
			// 			if (_this.$route.query.navId == 12 || _this.$route.query.navId == 13) {
			// 				_this.getdownlist()
			// 			} else if (_this.$route.query.navId == 14) {
			// 				_this.getgddt(row.id)
			// 			} else {
			// 				_this.getlist()
			// 			}
			// 		}
			// 	}
			// })
		},
		// 文章详情
		opendetails(id,columnId) {
			/*this.$router.push({
				name: 'articlecontent',
				query: { id: id, navId: this.$route.query.navId }
			})*/
      let routeData = ''
      if(columnId == 'F0CFAC8B75F84B52B5F0A44ABB17817C'){ // 值班日记
        routeData = this.$router.resolve({
          name: 'articleDutyRecordContent',
          query: { id: id, navId: this.$route.query.navId }
        })
      }else{
        routeData = this.$router.resolve({
            name: 'articlecontent',
            query: { id: id, navId: this.$route.query.navId }
        })
      }
      window.open(routeData.href, '_blank')
		},
		// 视频详情
		videodetails(id) {
			/*this.$router.push({
				name: 'videodetails',
				query: { id: id, navId: this.$route.query.navId }
			})*/
      let routeData = this.$router.resolve({
        name: 'videodetails',
        query: { id: id, navId: this.$route.query.navId }
      })
      window.open(routeData.href, '_blank')
		},
		// 精彩瞬间详情
		openjcsj(item) {
			if (item.fileUrl) {
				/*this.$router.push({
					name: 'videodetails',
					query: { id: item.id, navId: this.$route.query.navId }
				})*/
        let routeData = this.$router.resolve({
          name: 'videodetails',
          query: { id: item.id, navId: this.$route.query.navId }
        })
        window.open(routeData.href, '_blank')
			} else {
				/*this.$router.push({
					name: 'jcsjdetails',
					query: { id: item.id, navId: this.$route.query.navId }
				})*/
        let routeData = this.$router.resolve({
          name: 'jcsjdetails',
          query: { id: item.id, navId: this.$route.query.navId }
        })
        window.open(routeData.href, '_blank')
			}

		},
		// 获取下载中心子栏目
		getdownlist() {
			let data = {
				name: "",
				code: "",
				parentId: this.$route.query.id
			};
			columnqueryAll(data).then((res) => {
        console.log("下载中心和政策法规信息：",res);
        if (res.code == 0) {
					this.columnList = res.data.map(item => {
						item.children = []
						contentFourData({ columnId: item.id, approval:'1' }).then(reult => {
							if (reult.code == 0) {
								item.children = reult.data
							}
						})
						return item
					})
				}
			});
		},
		// 点击下载
		down(url) {
			console.log(url);
			if(url.indexOf(",") == -1){ // 不包含
        window.open("/show" + url)
      }else{ // 存在多个  就需要一个一个打开
        const arr = url.split(',')
        arr.forEach(item=>{
          window.open("/show" + item,"_blank")
        })
      }

		},
		// 更多
		more(id, title) {
			/*this.$router.push({
				name: 'listpage',
				query: { id: id, navId: this.$route.query.navId, title: title }
			})*/
      let routeData = this.$router.resolve({
        name: 'listpage',
        query: { id: id, navId: this.$route.query.navId, title: title }
      })
      window.open(routeData.href, '_blank')
		},
		// 动态更多
		morejigou(id, title) {
			/*this.$router.push({
				name: 'listpage',
				query: { id: this.form.columnId, orgId: id, navId: this.$route.query.navId, title: title }
			})*/
      let routeData = this.$router.resolve({
        name: 'listpage',
        query: { id: this.form.columnId, orgId: id, navId: this.$route.query.navId, title: title }
      })
      window.open(routeData.href, '_blank')
		},
		// 点赞功能
		dianzan(id) {
			contentThumbs({ id: id }).then(res => {
				if (res.code == 0) {
					this.$message.success("点赞成功！")
					this.getlist()
				}
			})
		},
		tip() {
			this.$message.warning("已经赞过了！")
		},
		search() {
			this.$router.push({
				name: 'searchresult',
			})
		},
	},
};
</script>
<style scoped>
@import "../assets/css/font/iconfont.css";
@import "../assets/css/index.css";
@import "../assets/css/style.css";
.p1{
  display: flex;
  justify-content: space-between;  /*两端对齐*/
}
</style>
